define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'event/index',
                    multi_url: 'order/multi',
                    table: 'user',
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                pagination:false,
                columns: [
                    [
                        {field: 'event', title: __('事件名称'), operate: 'LIKE',operate: false},
                        {field: 'z_user_sum', title: __('总点击人数'), operate: 'LIKE',operate: false},
                        {field: 'z_sum', title: __('总点击数量'), operate: 'LIKE',operate: false},
                        {field: 'xcx_user_sum', title: __('小程序点击人数'), operate: 'LIKE',operate: false},
                        {field: 'xcx_sum', title: __('小程序点击数量'), operate: 'LIKE',operate: false},
                        {field: 'app_user_sum', title: __('APP点击人数'), operate: 'LIKE',operate: false},
                        {field: 'app_sum', title: __('APP点击数量'), operate: 'LIKE',operate: false},
                        {field: 'add_time', title: '新增时间', formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange'},
                    ]
                ]
            });
            // 为表格绑定事件
            Table.api.bindevent(table);
            $('.commonsearch-table').removeClass('hidden');
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});